import React, { Component } from 'react';
import {index_banner} from '../api/index'
import '../styles/Swiper.css'
class Swiper extends Component {
    constructor(props){
        super(props);
        this.state={
            list:[],
            currentIndex:0
        }
    }
    componentDidMount(){
        index_banner().then((res)=>{
            console.log(res.data.list);
            this.setState({
                list:this.state.list
            })
        })
    }
    render() {
        return (
            <div className='swiper'>
                {
                    this.state.list.map((item,index)=>{
                        return (
                            <ul>
                                <li>
                                    <img src={item.pic} alt="" />
                                </li>
                            </ul>
                        )
                    })
                }
            </div>
        );
    }
}

export default Swiper;